package com.blog.service.impl;

import com.blog.dao.FolloweeDao;
import com.blog.dao.impl.FolloweeDaoImpl;
import com.blog.pojo.Followee;
import com.blog.service.FolloweeService;

import java.util.List;

public class FolloweeServiceImpl implements FolloweeService {
    private FolloweeDao followeeDao=new FolloweeDaoImpl();
    @Override
    public Followee addFollowee(Followee followee) {
        followeeDao.addFollowee(followee);
        return followee;
    }

    @Override
    public List<Followee> findByFolloweeId(int followeeId) {
        return followeeDao.findByFolloweeId(followeeId);
    }

    @Override
    public Followee findByUserIdAndFolloweeId(int uId, int followeeId) {
        return followeeDao.findByUserIdAndFolloweeId(uId, followeeId);
    }

    @Override
    public boolean delete(int uId, int followeeId) {
        int delete=followeeDao.delete(uId, followeeId);
        if(delete>0) {
            return true;
        }else {
            return false;
        }

    }

    @Override
    public List<Followee> findFanList(int followeeId) {
        return followeeDao.findFanList(followeeId);
    }

    @Override
    public int findFanCount(int followeeId) {
        return followeeDao.findFanCount(followeeId);
    }

    @Override
    public int addFanCount(int id) {
        return  followeeDao.addFanCount(id);
    }

    @Override
    public int reduceFanCount(int id) {
      return  followeeDao.reduceFanCount(id);

    }

    @Override
    public int findFolloweeCount(int uId) {
        return followeeDao.findFolloweeCount(uId);
    }

    @Override
    public List<Followee> findFolloweeList(int uId) {
        return followeeDao.findFolloweeList(uId);
    }

    @Override
    public int addFolloweeCount(int id) {
        return followeeDao.addFolloweeCount(id);
    }

    @Override
    public int reduceFolloweeCount(int id) {
        return followeeDao.reduceFolloweeCount(id);
    }
}
